#ifndef __ROBOT_H__
#define __ROBOT_H__
#include "GameObject.h"
#include "vector2d.h"
#include "Timer.h"
class ASprite;


class Robot :public GameObject
{
public:
	
	Robot();


	
protected:
	ASprite* m_sprite;

	vector2df m_targetPoint;

	vector2df m_Speed;
	vector2df m_displacement;

	bool m_bIsMovementEnabled;

	int m_radiusHead;
	int m_hp;
	bool m_bMoved;
	float m_TimeReload;

	Timer		m_cooldownTimer;
public:
	virtual void Load(IAttributes* attr);
	virtual void InitPhysics();
	virtual void Draw();
	virtual void Update();
	virtual void Initialize();
	virtual void TakeDamage(int damage);
	virtual void SaveData(CWriteFile* stream);
	virtual void LoadData(CReadFile* stream);

	virtual void Update_PreCollision();
	virtual void Update_PostCollision();
	virtual bool ShouldCollideWith( GameObject* h );
	//virtual void ResolveCollisions();
	//virtual void TestCollisions(GameObject* obj,vector2df* resultant);
	
	bool		CanMove() const {return m_bIsMovementEnabled;}
	void		EnableMovement() { m_bIsMovementEnabled = true; }
	void		DisableMovement() { m_bIsMovementEnabled = false; SetNoDisplacement();}
	void		SetNoDisplacement();
	void		SetTarget(float tx,float ty);
	void reset();

	
	void CompDisplacement();

	struct Status
	{
		float m_TimeCountdown;
	};

	Status m_status;

};
#endif